<?php
$model = new BWMessageFormModel();
if ($messageId > 0) {//for modify
    $message = new BWMessage($messageId);
    $model->name = $message->name;
    $model->description = $message->description;
}
Blyn::app()->getUIManager()->getCurrentScreen()->addContextVariable('messageId', $messageId);
Blyn::app()->getUIManager()->getCurrentScreen()->addContextVariable('eventId', $eventId);
?>
<?php echo CHtml::beginForm(); ?>
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3>添加品牌</h3>
</div>
<div class="modal-body" id="Event_Add_Body" style="display:block">

    <table class="table table-bordered table-striped">
        <colgroup>
            <col class="span1">
            <col class="span7">
        </colgroup>
        <thead>
            <tr>
                <th>品牌属性</th>
                <th>详细内容</th>
            </tr>
        </thead>
        <tbody>
            <tr><td> <code>品牌名称</code> </td>
                <td><?php echo CHtml::activeTextArea($model, 'name', array('name' => "messageName" . $messageId, 'placeholder' => '品牌名称...', 'required' => true)); ?></td>
            </tr>
            <tr><td><code>品牌logo</code> </td>
                <td>  <input type="file" name="shoppicture0"  id="shoppicture0"></td>
            </tr>
            <tr>
                <td> <code>品牌详细内容</code>  </td>
                <td><?php echo CHtml::activeTextArea($model, 'description', array('name' => "messageDesc" . $messageId, 'placeholder' => '品牌描述...')); ?></td>
            </tr>
        </tbody>
    </table>
</div> 
<div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
    <?php
    echo $control->getAjaxLink(array('name' => '保存', 'id' => 'saveMessage1'), array('messageId' => $messageId, 'htmlOptions' => array('class' => 'btn', 'enctype' => 'multipart/form-data')));
    ?>
</div>
<?php echo CHtml::endForm(); ?>